#include "v_cpu.h"
#include "type.h"

void v_cpu::add_EbGbR(instruction *i) {
	bit8u op1, op2, sum;

	op1 = AVM_READ_8BIT_REG(i->rm());
	op2 = AVM_READ_8BIT_REG(i->nnn());

	sum = op1 + op2;
	AVM_WRITE_8BIT_REG(i->rm(), sum);	

	SET_EFLAGS_OSZAPC_ADD_8(op1, op2, sum);
}

void v_cpu::add_EwGwR(instruction *i) {
	bit16u op1, op2, sum;

	op1 = AVM_READ_16BIT_REG(i->rm());
	op2 = AVM_READ_16BIT_REG(i->nnn());

	sum = op1 + op2;
	AVM_WRITE_16BIT_REG(i->rm(), sum);

	SET_EFLAGS_OSZAPC_ADD_16(op1, op2, sum);
}

void v_cpu::add_EbGbM(instruction *i) {
	 
}
